package com.gen.info.generate_cluster_information.util;

import java.util.ArrayList;
import java.util.List;

public class CommonUtil {
    //获取unit_NUM
    public static Integer getUnitNum(String value){
        return Integer.parseInt(value.split("-")[0]);
    }
    //获取zonelist
    public static ArrayList<String> getZoneList(String value){
        final ArrayList<String> list = new ArrayList<>();
        final int zone_num = value.split("-").length;
        for (int i = 1; i <= zone_num; i++) {
            list.add("zone"+i);
        }
        return list;
    }
    public static  String getAuthList(List<String> auth){
        //if (auth.get(1)=="all_privileges")
        return auth.toString().replace("[", "").replace("]", "");
    }
}
